package com.carstop.model;

import java.text.DateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.json.JSONArray;

import com.member.model.MemberVO;

public class CarStopJsonHandler {

	
	public CarStopJsonHandler() {
		super();
	}

	public JSONArray toJSONArray(List<CarStopVO> carstopList) {
		ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();
		for (CarStopVO carstop : carstopList) {
			HashMap map = new HashMap();
			
			String stop_id=carstop.getStop_id();			
			String name = carstop.getName();		
			Double stop_longitude = carstop.getStop_longitude();
			Double stop_latitude = carstop.getStop_latitude();	
		
			
			map.put("stop_id", stop_id);
			map.put("name", name);
			map.put("stop_longitude", stop_longitude);
			map.put("stop_latitude", stop_latitude);
			
			list.add(map);		
			
		}
		JSONArray stopJson = new JSONArray(list);
		return stopJson;
	}

	
	
	
	
	
	
	
	
}
